package com.swagger.demo.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.beans.Transient;

@Api("用户管理")
@RestController
public class UserController {

    @ApiOperation("获取用户")
    @GetMapping("user")
    public String getUser() {
        return "add user";
    }

    @ApiOperation("保存用户")
    @PostMapping("user")
    public String save() {
        return "save user";
    }

    @ApiImplicitParam(paramType = "path", dataType = "Long", name = "id", value = "用户编号", required = true, example = "1")
    @ApiOperation(value = "删除用户",notes = "根据用户ID删除用户")
    @DeleteMapping("user")
    public String delUser() {
        return "delete user";
    }

    @ApiOperation("更新用户")
    @PutMapping("user")
    public String putUser() {
        return "put user";
    }
}
